\hypertarget{uart_8c}{}\section{esp8266/uart.c File Reference}
\label{uart_8c}\index{esp8266/uart.\+c@{esp8266/uart.\+c}}


Uart driver for E\+S\+P8266.  


{\ttfamily \#include \char`\"{}user\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}uart.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}uart\+\_\+register.\+h\char`\"{}}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{uart_8c_a14061d90f6727665218418b15943af7f}{U\+A\+R\+TS}~2
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{uart_8c_ae08356fea716912edfef1013171b24ba}{uart\+\_\+rx\+\_\+enable} (uint8 uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Enable receive interrupts for a uart. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_a4c32ce5693fc8c1a40244b5cc82e796e}{uart\+\_\+rx\+\_\+disable} (uint8 uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Disable receive interrupts for a uart. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_a9fee6d0362cbec0ae882acb55d3a825f}{uart\+\_\+tx\+\_\+enable} (\hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Enable transmit interrupts for a uart. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_a87198ab19fb4f97a978baf08b478d150}{uart\+\_\+tx\+\_\+disable} (\hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Disable transmit interrupts for a uart. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_a69f8feef88b9921367f37e8db445eeaf}{tx\+\_\+fifo\+\_\+flush} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Flush transmit fifo for a uart. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_a6b9147fc5ffaf0a602cc60a8addb8a38}{rx\+\_\+fifo\+\_\+flush} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Flush receive fifo for a uart. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a6f8397ebf08ae984ed48144d0287a048}{tx\+\_\+fifo\+\_\+used} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Get the number of bytes used in transmit fifo. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a3c0f172370540e0d1840c415c2c7b661}{tx\+\_\+fifo\+\_\+free} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Get the number of bytes free in transmit fifo. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a50e81b3a1433d1947bdff1b9bdf425d3}{tx\+\_\+fifo\+\_\+empty} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Test if the transmit fifo is empty. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a09c378ce1610cb5e63469a4ee6813de2}{rx\+\_\+fifo\+\_\+used} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Get the number of bytes used in receive fifo. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_aa59d5d55b7cd6551d97ef6af22949c82}{rx\+\_\+fifo\+\_\+free} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Get the number of bytes free in receive fifo. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a3ffd1f20ba2ca3ef0894473091b25012}{rx\+\_\+fifo\+\_\+empty} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Test if the receive fifo is empty. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_ae0c0e0aa888920f223867fa541b068ac}{tx\+\_\+fifo\+\_\+putb} (int uart\+\_\+no, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} c)
\begin{DoxyCompactList}\small\item\em Add a byte to the trasmit fifo We assume that \hyperlink{uart_8c_a3c0f172370540e0d1840c415c2c7b661}{tx\+\_\+fifo\+\_\+free()} was called! \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a41c7b573c10fdd3aadc72669f96c2e71}{rx\+\_\+fifo\+\_\+getb} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Remove a byte from the receive fifo We assume that \hyperlink{uart_8c_a09c378ce1610cb5e63469a4ee6813de2}{rx\+\_\+fifo\+\_\+used()} was called! \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a6658637d750ec2e2366ac3881dbd9f6e}{tx\+\_\+fifo\+\_\+write} (int uart\+\_\+no, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$buf, int size)
\begin{DoxyCompactList}\small\item\em Write a data buffer to the transmit fifo Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a5ee039ccb34468de12203a7027fee1ce}{rx\+\_\+fifo\+\_\+read} (int uart\+\_\+no, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} $\ast$buf, int size)
\begin{DoxyCompactList}\small\item\em Read a data buffer from the receive fifo Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. \end{DoxyCompactList}\item 
L\+O\+C\+AL \hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a5d37288e478d3aefe796f405d90e2c06}{uart\+\_\+putb} (uint8 uart\+\_\+no, uint8 data)
\begin{DoxyCompactList}\small\item\em Polled Blocking I/O functions that poll. \end{DoxyCompactList}\item 
L\+O\+C\+AL \hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a385bdf5aba0beedc8862cb7afff7fee7}{uart\+\_\+getb} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Read a byte from a uart Note\+: This function waits/blocks util the read can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_aad52b616aa1f07c5a59a5ddb6be602dc}{uart\+\_\+putc} (uint8 uart\+\_\+no, char c)
\begin{DoxyCompactList}\small\item\em Write a byte from a uart with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_adf42ba60e6a57087df07a521240569c7}{uart\+\_\+getc} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Read a byte from a uart with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_ad5837c0512e852837f615c22769355c9}{uart0\+\_\+putc} (uint8 c)
\begin{DoxyCompactList}\small\item\em Write a byte to uart0 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_ac64481d3ee365de4479ba579b5736a1c}{uart0\+\_\+getc} ()
\begin{DoxyCompactList}\small\item\em Read a byte from uart0 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a68627c49cc4901c400c82adeea5a6b1d}{uart1\+\_\+putc} (uint8 c)
\begin{DoxyCompactList}\small\item\em Write a byte to uart1 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} int \hyperlink{uart_8c_a737b67ce3c8c77f547a29a06dd0b45b1}{uart1\+\_\+getc} ()
\begin{DoxyCompactList}\small\item\em Read a byte from uart1 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{uart_8c_a735a90ff2c030a454e0e08d1cd4d79e9}{uart\+\_\+flush} (\hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Flush TX buffer Note\+: This function waits/blocks util the write happen. \end{DoxyCompactList}\item 
int \hyperlink{uart_8c_adba60d396ad1ae85a31880b05758e460}{kbhiteol} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Has an E\+OL been read on stdin ? \end{DoxyCompactList}\item 
int \hyperlink{uart_8c_a27dccd1929734deb5d318a0cf44bd7c5}{kbhit} (int uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Has A\+NY character been read in stdin. \end{DoxyCompactList}\item 
void \hyperlink{uart_8c_aa018dc93fd77400560f0ab7e8d78f59a}{uart\+\_\+callback} (void $\ast$p)
\begin{DoxyCompactList}\small\item\em Uart interrupt callback function Process all receive and transmit events here. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{uart_8c_a83db8ea8db21280f74e2546414fc80f7}{U\+A\+R\+T\+\_\+\+Set\+Print\+Port} (uint8 uart\+\_\+no)
\begin{DoxyCompactList}\small\item\em Install debug uart. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{uart_8c_afde4532b11b79411c904be3b2672c5e8}{uart\+\_\+config} (uint8 uart\+\_\+no, \hyperlink{send_8c_a435d1572bf3f880d55459d9805097f62}{uint32\+\_\+t} baud, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} data\+\_\+bits, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} stop\+\_\+bits, \hyperlink{send_8c_aba7bc1797add20fe3efdf37ced1182c5}{uint8\+\_\+t} parity)
\begin{DoxyCompactList}\small\item\em Uart configuration, baud rate, data and stop bits, parity. \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{uart_8c_a5afb95571d79d939651ef59768fde839}{uart\+\_\+init} (\hyperlink{uart_8h_a9aa1e56362027f49bfbe4378b8c889a4}{Uart\+Baud\+Rate} uart0\+\_\+br, \hyperlink{uart_8h_a9aa1e56362027f49bfbe4378b8c889a4}{Uart\+Baud\+Rate} uart1\+\_\+br)
\begin{DoxyCompactList}\small\item\em initialize uart0 and uart1 Defaults\+: 8 = data bits, 1 = stop bits, no parity \end{DoxyCompactList}\item 
\hyperlink{earth2wireframe_8c_ad0fe97585b8891f5e4f2b9a6426330a4}{M\+E\+M\+S\+P\+A\+CE} void \hyperlink{uart_8c_ae2429f7cf15a9fba99f1c3d1d6499299}{uart\+\_\+reattach} ()
\begin{DoxyCompactList}\small\item\em Reinitialize uart0 and uart1 calls \hyperlink{uart_8c_a5afb95571d79d939651ef59768fde839}{uart\+\_\+init()} \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Variables}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{uart_8c_a08d467da958b2c20aaa794953255d152}{uart\+\_\+debug\+\_\+port} = 0
\end{DoxyCompactItemize}


\subsection{Detailed Description}
Uart driver for E\+S\+P8266. 

Uart driver for E\+S\+P8266 based on Esprissif documents.

\begin{DoxyParagraph}{Copyright \copyright{} 2015 Mike Gore, G\+PL License}

\end{DoxyParagraph}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}.

\begin{DoxySeeAlso}{See also}
\href{http://bbs.espressif.com/viewtopic.php?f=21&t=414}{\tt http\+://bbs.\+espressif.\+com/viewtopic.\+php?f=21\&t=414}
\end{DoxySeeAlso}
\begin{DoxyParagraph}{Copyright \copyright{} 2015 Mike Gore, G\+PL License}

\end{DoxyParagraph}
\begin{DoxyParagraph}{You are free to use this code under the terms of G\+PL}
please retain a copy of this notice in any code you use it in.
\end{DoxyParagraph}
This is free software\+: you can redistribute it and/or modify it under the terms of the G\+NU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but W\+I\+T\+H\+O\+UT A\+NY W\+A\+R\+R\+A\+N\+TY; without even the implied warranty of M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY or F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE. See the G\+NU General Public License for more details.

You should have received a copy of the G\+NU General Public License along with this program. If not, see \href{http://www.gnu.org/licenses/}{\tt http\+://www.\+gnu.\+org/licenses/}. 

\subsection{Macro Definition Documentation}
\index{uart.\+c@{uart.\+c}!U\+A\+R\+TS@{U\+A\+R\+TS}}
\index{U\+A\+R\+TS@{U\+A\+R\+TS}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{U\+A\+R\+TS}{UARTS}}]{\setlength{\rightskip}{0pt plus 5cm}\#define U\+A\+R\+TS~2}\hypertarget{uart_8c_a14061d90f6727665218418b15943af7f}{}\label{uart_8c_a14061d90f6727665218418b15943af7f}


Definition at line 34 of file uart.\+c.



\subsection{Function Documentation}
\index{uart.\+c@{uart.\+c}!kbhit@{kbhit}}
\index{kbhit@{kbhit}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{kbhit(int uart\+\_\+no)}{kbhit(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}int kbhit (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a27dccd1929734deb5d318a0cf44bd7c5}{}\label{uart_8c_a27dccd1929734deb5d318a0cf44bd7c5}


Has A\+NY character been read in stdin. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 585 of file uart.\+c.



Referenced by testpage().

\index{uart.\+c@{uart.\+c}!kbhiteol@{kbhiteol}}
\index{kbhiteol@{kbhiteol}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{kbhiteol(int uart\+\_\+no)}{kbhiteol(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}int kbhiteol (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_adba60d396ad1ae85a31880b05758e460}{}\label{uart_8c_adba60d396ad1ae85a31880b05758e460}


Has an E\+OL been read on stdin ? 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 572 of file uart.\+c.



Referenced by user\+\_\+tasks().

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+empty@{rx\+\_\+fifo\+\_\+empty}}
\index{rx\+\_\+fifo\+\_\+empty@{rx\+\_\+fifo\+\_\+empty}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+empty(int uart\+\_\+no)}{rx_fifo_empty(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int rx\+\_\+fifo\+\_\+empty (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a3ffd1f20ba2ca3ef0894473091b25012}{}\label{uart_8c_a3ffd1f20ba2ca3ef0894473091b25012}


Test if the receive fifo is empty. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if empty, 0 otherwise 
\end{DoxyReturn}


Definition at line 182 of file uart.\+c.



Referenced by uart\+\_\+getb().

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+flush@{rx\+\_\+fifo\+\_\+flush}}
\index{rx\+\_\+fifo\+\_\+flush@{rx\+\_\+fifo\+\_\+flush}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+flush(int uart\+\_\+no)}{rx_fifo_flush(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void rx\+\_\+fifo\+\_\+flush (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a6b9147fc5ffaf0a602cc60a8addb8a38}{}\label{uart_8c_a6b9147fc5ffaf0a602cc60a8addb8a38}


Flush receive fifo for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 105 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+free@{rx\+\_\+fifo\+\_\+free}}
\index{rx\+\_\+fifo\+\_\+free@{rx\+\_\+fifo\+\_\+free}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+free(int uart\+\_\+no)}{rx_fifo_free(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int rx\+\_\+fifo\+\_\+free (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_aa59d5d55b7cd6551d97ef6af22949c82}{}\label{uart_8c_aa59d5d55b7cd6551d97ef6af22949c82}


Get the number of bytes free in receive fifo. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes free 
\end{DoxyReturn}


Definition at line 168 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+getb@{rx\+\_\+fifo\+\_\+getb}}
\index{rx\+\_\+fifo\+\_\+getb@{rx\+\_\+fifo\+\_\+getb}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+getb(int uart\+\_\+no)}{rx_fifo_getb(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int rx\+\_\+fifo\+\_\+getb (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a41c7b573c10fdd3aadc72669f96c2e71}{}\label{uart_8c_a41c7b573c10fdd3aadc72669f96c2e71}


Remove a byte from the receive fifo We assume that \hyperlink{uart_8c_a09c378ce1610cb5e63469a4ee6813de2}{rx\+\_\+fifo\+\_\+used()} was called! 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
c, (or 0 if fill user error) 
\end{DoxyReturn}


Definition at line 217 of file uart.\+c.



Referenced by uart\+\_\+getb().

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+read@{rx\+\_\+fifo\+\_\+read}}
\index{rx\+\_\+fifo\+\_\+read@{rx\+\_\+fifo\+\_\+read}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+read(int uart\+\_\+no, uint8\+\_\+t $\ast$buf, int size)}{rx_fifo_read(int uart_no, uint8_t *buf, int size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int rx\+\_\+fifo\+\_\+read (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no, }
\item[{{\bf uint8\+\_\+t} $\ast$}]{buf, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a5ee039ccb34468de12203a7027fee1ce}{}\label{uart_8c_a5ee039ccb34468de12203a7027fee1ce}


Read a data buffer from the receive fifo Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em $\ast$buf} & output buffer \\
\hline
\mbox{\tt in}  & {\em size} & size of output buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes actually read from the fifo -\/ may not be size! 
\end{DoxyReturn}


Definition at line 264 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!rx\+\_\+fifo\+\_\+used@{rx\+\_\+fifo\+\_\+used}}
\index{rx\+\_\+fifo\+\_\+used@{rx\+\_\+fifo\+\_\+used}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{rx\+\_\+fifo\+\_\+used(int uart\+\_\+no)}{rx_fifo_used(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int rx\+\_\+fifo\+\_\+used (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a09c378ce1610cb5e63469a4ee6813de2}{}\label{uart_8c_a09c378ce1610cb5e63469a4ee6813de2}


Get the number of bytes used in receive fifo. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes in use 
\end{DoxyReturn}


Definition at line 155 of file uart.\+c.



Referenced by rx\+\_\+fifo\+\_\+getb(), and rx\+\_\+fifo\+\_\+read().

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+empty@{tx\+\_\+fifo\+\_\+empty}}
\index{tx\+\_\+fifo\+\_\+empty@{tx\+\_\+fifo\+\_\+empty}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+empty(int uart\+\_\+no)}{tx_fifo_empty(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int tx\+\_\+fifo\+\_\+empty (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a50e81b3a1433d1947bdff1b9bdf425d3}{}\label{uart_8c_a50e81b3a1433d1947bdff1b9bdf425d3}


Test if the transmit fifo is empty. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if empty, 0 otherwise 
\end{DoxyReturn}


Definition at line 143 of file uart.\+c.



Referenced by uart\+\_\+flush().

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+flush@{tx\+\_\+fifo\+\_\+flush}}
\index{tx\+\_\+fifo\+\_\+flush@{tx\+\_\+fifo\+\_\+flush}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+flush(int uart\+\_\+no)}{tx_fifo_flush(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void tx\+\_\+fifo\+\_\+flush (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a69f8feef88b9921367f37e8db445eeaf}{}\label{uart_8c_a69f8feef88b9921367f37e8db445eeaf}


Flush transmit fifo for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 94 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+free@{tx\+\_\+fifo\+\_\+free}}
\index{tx\+\_\+fifo\+\_\+free@{tx\+\_\+fifo\+\_\+free}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+free(int uart\+\_\+no)}{tx_fifo_free(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int tx\+\_\+fifo\+\_\+free (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a3c0f172370540e0d1840c415c2c7b661}{}\label{uart_8c_a3c0f172370540e0d1840c415c2c7b661}


Get the number of bytes free in transmit fifo. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes free 
\end{DoxyReturn}


Definition at line 130 of file uart.\+c.



Referenced by tx\+\_\+fifo\+\_\+putb(), tx\+\_\+fifo\+\_\+write(), and uart\+\_\+putb().

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+putb@{tx\+\_\+fifo\+\_\+putb}}
\index{tx\+\_\+fifo\+\_\+putb@{tx\+\_\+fifo\+\_\+putb}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+putb(int uart\+\_\+no, uint8\+\_\+t c)}{tx_fifo_putb(int uart_no, uint8_t c)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int tx\+\_\+fifo\+\_\+putb (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no, }
\item[{{\bf uint8\+\_\+t}}]{c}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_ae0c0e0aa888920f223867fa541b068ac}{}\label{uart_8c_ae0c0e0aa888920f223867fa541b068ac}


Add a byte to the trasmit fifo We assume that \hyperlink{uart_8c_a3c0f172370540e0d1840c415c2c7b661}{tx\+\_\+fifo\+\_\+free()} was called! 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em c} & byte to add \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
c, (or 0 if full user error) 
\end{DoxyReturn}


Definition at line 199 of file uart.\+c.



Referenced by uart\+\_\+putb().

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+used@{tx\+\_\+fifo\+\_\+used}}
\index{tx\+\_\+fifo\+\_\+used@{tx\+\_\+fifo\+\_\+used}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+used(int uart\+\_\+no)}{tx_fifo_used(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int tx\+\_\+fifo\+\_\+used (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a6f8397ebf08ae984ed48144d0287a048}{}\label{uart_8c_a6f8397ebf08ae984ed48144d0287a048}


Get the number of bytes used in transmit fifo. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bytes in use 
\end{DoxyReturn}


Definition at line 118 of file uart.\+c.



Referenced by uart\+\_\+flush().

\index{uart.\+c@{uart.\+c}!tx\+\_\+fifo\+\_\+write@{tx\+\_\+fifo\+\_\+write}}
\index{tx\+\_\+fifo\+\_\+write@{tx\+\_\+fifo\+\_\+write}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{tx\+\_\+fifo\+\_\+write(int uart\+\_\+no, uint8\+\_\+t $\ast$buf, int size)}{tx_fifo_write(int uart_no, uint8_t *buf, int size)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int tx\+\_\+fifo\+\_\+write (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no, }
\item[{{\bf uint8\+\_\+t} $\ast$}]{buf, }
\item[{int}]{size}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a6658637d750ec2e2366ac3881dbd9f6e}{}\label{uart_8c_a6658637d750ec2e2366ac3881dbd9f6e}


Write a data buffer to the transmit fifo Note\+: This function does not wait/block util there is enough free space to meet the request. So you must check that the return value matches the size. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em $\ast$buf} & output buffer \\
\hline
\mbox{\tt in}  & {\em size} & size of input buffer \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes sent 
\end{DoxyReturn}


Definition at line 237 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart0\+\_\+getc@{uart0\+\_\+getc}}
\index{uart0\+\_\+getc@{uart0\+\_\+getc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart0\+\_\+getc()}{uart0_getc()}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart0\+\_\+getc (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_ac64481d3ee365de4479ba579b5736a1c}{}\label{uart_8c_ac64481d3ee365de4479ba579b5736a1c}


Read a byte from uart0 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. 

\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 369 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart0\+\_\+putc@{uart0\+\_\+putc}}
\index{uart0\+\_\+putc@{uart0\+\_\+putc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart0\+\_\+putc(uint8 c)}{uart0_putc(uint8 c)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart0\+\_\+putc (
\begin{DoxyParamCaption}
\item[{uint8}]{c}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_ad5837c0512e852837f615c22769355c9}{}\label{uart_8c_ad5837c0512e852837f615c22769355c9}


Write a byte to uart0 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em c} & byte to write \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 358 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart1\+\_\+getc@{uart1\+\_\+getc}}
\index{uart1\+\_\+getc@{uart1\+\_\+getc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart1\+\_\+getc()}{uart1_getc()}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart1\+\_\+getc (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a737b67ce3c8c77f547a29a06dd0b45b1}{}\label{uart_8c_a737b67ce3c8c77f547a29a06dd0b45b1}


Read a byte from uart1 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. 

\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 393 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart1\+\_\+putc@{uart1\+\_\+putc}}
\index{uart1\+\_\+putc@{uart1\+\_\+putc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart1\+\_\+putc(uint8 c)}{uart1_putc(uint8 c)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart1\+\_\+putc (
\begin{DoxyParamCaption}
\item[{uint8}]{c}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a68627c49cc4901c400c82adeea5a6b1d}{}\label{uart_8c_a68627c49cc4901c400c82adeea5a6b1d}


Write a byte to uart1 with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em c} & byte to write \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 382 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+callback@{uart\+\_\+callback}}
\index{uart\+\_\+callback@{uart\+\_\+callback}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+callback(void $\ast$p)}{uart_callback(void *p)}}]{\setlength{\rightskip}{0pt plus 5cm}void uart\+\_\+callback (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{p}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_aa018dc93fd77400560f0ab7e8d78f59a}{}\label{uart_8c_aa018dc93fd77400560f0ab7e8d78f59a}


Uart interrupt callback function Process all receive and transmit events here. 

=================================================================

/$\ast$$\ast$ 
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em $\ast$p} & callback pointer -\/ currently unused \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 604 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+config@{uart\+\_\+config}}
\index{uart\+\_\+config@{uart\+\_\+config}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+config(uint8 uart\+\_\+no, uint32\+\_\+t baud, uint8\+\_\+t data\+\_\+bits, uint8\+\_\+t stop\+\_\+bits, uint8\+\_\+t parity)}{uart_config(uint8 uart_no, uint32_t baud, uint8_t data_bits, uint8_t stop_bits, uint8_t parity)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void uart\+\_\+config (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no, }
\item[{{\bf uint32\+\_\+t}}]{baud, }
\item[{{\bf uint8\+\_\+t}}]{data\+\_\+bits, }
\item[{{\bf uint8\+\_\+t}}]{stop\+\_\+bits, }
\item[{{\bf uint8\+\_\+t}}]{parity}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_afde4532b11b79411c904be3b2672c5e8}{}\label{uart_8c_afde4532b11b79411c904be3b2672c5e8}


Uart configuration, baud rate, data and stop bits, parity. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em baud} & baud \\
\hline
\mbox{\tt in}  & {\em data\+\_\+bits} & number of data bits, 5 .. 8 \\
\hline
\mbox{\tt in}  & {\em stop\+\_\+bits} & number of stop bits, O\+N\+E\+\_\+\+S\+T\+O\+P\+\_\+\+B\+I\+T$\vert$\+T\+W\+O\+\_\+\+S\+T\+O\+P\+\_\+\+B\+IT \\
\hline
\mbox{\tt in}  & {\em parity} & parity, N\+O\+\_\+\+P\+A\+R\+I\+TY,O\+D\+D\+\_\+\+P\+A\+R\+I\+TY,E\+V\+E\+N\+\_\+\+P\+A\+R\+I\+TY \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 714 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+flush@{uart\+\_\+flush}}
\index{uart\+\_\+flush@{uart\+\_\+flush}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+flush(uint8\+\_\+t uart\+\_\+no)}{uart_flush(uint8_t uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void uart\+\_\+flush (
\begin{DoxyParamCaption}
\item[{{\bf uint8\+\_\+t}}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a735a90ff2c030a454e0e08d1cd4d79e9}{}\label{uart_8c_a735a90ff2c030a454e0e08d1cd4d79e9}


Flush TX buffer Note\+: This function waits/blocks util the write happen. 

\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 406 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+getb@{uart\+\_\+getb}}
\index{uart\+\_\+getb@{uart\+\_\+getb}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+getb(int uart\+\_\+no)}{uart_getb(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+O\+C\+AL {\bf M\+E\+M\+S\+P\+A\+CE} int uart\+\_\+getb (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a385bdf5aba0beedc8862cb7afff7fee7}{}\label{uart_8c_a385bdf5aba0beedc8862cb7afff7fee7}


Read a byte from a uart Note\+: This function waits/blocks util the read can happen. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 304 of file uart.\+c.



Referenced by uart\+\_\+getc().

\index{uart.\+c@{uart.\+c}!uart\+\_\+getc@{uart\+\_\+getc}}
\index{uart\+\_\+getc@{uart\+\_\+getc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+getc(int uart\+\_\+no)}{uart_getc(int uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart\+\_\+getc (
\begin{DoxyParamCaption}
\item[{int}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_adf42ba60e6a57087df07a521240569c7}{}\label{uart_8c_adf42ba60e6a57087df07a521240569c7}


Read a byte from a uart with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the read can happen. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
byte read 
\end{DoxyReturn}


Definition at line 337 of file uart.\+c.



Referenced by uart0\+\_\+getc(), and uart1\+\_\+getc().

\index{uart.\+c@{uart.\+c}!uart\+\_\+init@{uart\+\_\+init}}
\index{uart\+\_\+init@{uart\+\_\+init}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+init(\+Uart\+Baud\+Rate uart0\+\_\+br, Uart\+Baud\+Rate uart1\+\_\+br)}{uart_init(UartBaudRate uart0_br, UartBaudRate uart1_br)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void uart\+\_\+init (
\begin{DoxyParamCaption}
\item[{{\bf Uart\+Baud\+Rate}}]{uart0\+\_\+br, }
\item[{{\bf Uart\+Baud\+Rate}}]{uart1\+\_\+br}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a5afb95571d79d939651ef59768fde839}{}\label{uart_8c_a5afb95571d79d939651ef59768fde839}


initialize uart0 and uart1 Defaults\+: 8 = data bits, 1 = stop bits, no parity 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart0\+\_\+br} & baud rate for uart 0 \\
\hline
\mbox{\tt in}  & {\em uart1\+\_\+br} & baud rate for uart 1 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 773 of file uart.\+c.



Referenced by setup().

\index{uart.\+c@{uart.\+c}!uart\+\_\+putb@{uart\+\_\+putb}}
\index{uart\+\_\+putb@{uart\+\_\+putb}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+putb(uint8 uart\+\_\+no, uint8 data)}{uart_putb(uint8 uart_no, uint8 data)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+O\+C\+AL {\bf M\+E\+M\+S\+P\+A\+CE} int uart\+\_\+putb (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no, }
\item[{uint8}]{data}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a5d37288e478d3aefe796f405d90e2c06}{}\label{uart_8c_a5d37288e478d3aefe796f405d90e2c06}


Polled Blocking I/O functions that poll. 

Write a byte to a uart Note\+: This function waits/blocks util the write can happen 
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em data} & byte to write \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 289 of file uart.\+c.



Referenced by uart\+\_\+putc().

\index{uart.\+c@{uart.\+c}!uart\+\_\+putc@{uart\+\_\+putc}}
\index{uart\+\_\+putc@{uart\+\_\+putc}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+putc(uint8 uart\+\_\+no, char c)}{uart_putc(uint8 uart_no, char c)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} int uart\+\_\+putc (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no, }
\item[{char}]{c}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_aad52b616aa1f07c5a59a5ddb6be602dc}{}\label{uart_8c_aad52b616aa1f07c5a59a5ddb6be602dc}


Write a byte from a uart with NL to C\+R/\+NL conversion Note\+: This function waits/blocks util the write can happen. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\mbox{\tt in}  & {\em c} & character \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 323 of file uart.\+c.



Referenced by \+\_\+uart0\+\_\+fn(), fatfs\+\_\+ls(), uart0\+\_\+putc(), and uart1\+\_\+putc().

\index{uart.\+c@{uart.\+c}!uart\+\_\+reattach@{uart\+\_\+reattach}}
\index{uart\+\_\+reattach@{uart\+\_\+reattach}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+reattach()}{uart_reattach()}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void uart\+\_\+reattach (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_ae2429f7cf15a9fba99f1c3d1d6499299}{}\label{uart_8c_ae2429f7cf15a9fba99f1c3d1d6499299}


Reinitialize uart0 and uart1 calls \hyperlink{uart_8c_a5afb95571d79d939651ef59768fde839}{uart\+\_\+init()} 

\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 822 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+rx\+\_\+disable@{uart\+\_\+rx\+\_\+disable}}
\index{uart\+\_\+rx\+\_\+disable@{uart\+\_\+rx\+\_\+disable}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+rx\+\_\+disable(uint8 uart\+\_\+no)}{uart_rx_disable(uint8 uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void uart\+\_\+rx\+\_\+disable (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a4c32ce5693fc8c1a40244b5cc82e796e}{}\label{uart_8c_a4c32ce5693fc8c1a40244b5cc82e796e}


Disable receive interrupts for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 62 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+rx\+\_\+enable@{uart\+\_\+rx\+\_\+enable}}
\index{uart\+\_\+rx\+\_\+enable@{uart\+\_\+rx\+\_\+enable}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+rx\+\_\+enable(uint8 uart\+\_\+no)}{uart_rx_enable(uint8 uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void uart\+\_\+rx\+\_\+enable (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_ae08356fea716912edfef1013171b24ba}{}\label{uart_8c_ae08356fea716912edfef1013171b24ba}


Enable receive interrupts for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 52 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!U\+A\+R\+T\+\_\+\+Set\+Print\+Port@{U\+A\+R\+T\+\_\+\+Set\+Print\+Port}}
\index{U\+A\+R\+T\+\_\+\+Set\+Print\+Port@{U\+A\+R\+T\+\_\+\+Set\+Print\+Port}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{U\+A\+R\+T\+\_\+\+Set\+Print\+Port(uint8 uart\+\_\+no)}{UART_SetPrintPort(uint8 uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+E\+M\+S\+P\+A\+CE} void U\+A\+R\+T\+\_\+\+Set\+Print\+Port (
\begin{DoxyParamCaption}
\item[{uint8}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a83db8ea8db21280f74e2546414fc80f7}{}\label{uart_8c_a83db8ea8db21280f74e2546414fc80f7}


Install debug uart. 

\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 682 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+tx\+\_\+disable@{uart\+\_\+tx\+\_\+disable}}
\index{uart\+\_\+tx\+\_\+disable@{uart\+\_\+tx\+\_\+disable}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+tx\+\_\+disable(uint8\+\_\+t uart\+\_\+no)}{uart_tx_disable(uint8_t uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void uart\+\_\+tx\+\_\+disable (
\begin{DoxyParamCaption}
\item[{{\bf uint8\+\_\+t}}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a87198ab19fb4f97a978baf08b478d150}{}\label{uart_8c_a87198ab19fb4f97a978baf08b478d150}


Disable transmit interrupts for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 82 of file uart.\+c.

\index{uart.\+c@{uart.\+c}!uart\+\_\+tx\+\_\+enable@{uart\+\_\+tx\+\_\+enable}}
\index{uart\+\_\+tx\+\_\+enable@{uart\+\_\+tx\+\_\+enable}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+tx\+\_\+enable(uint8\+\_\+t uart\+\_\+no)}{uart_tx_enable(uint8_t uart_no)}}]{\setlength{\rightskip}{0pt plus 5cm}void uart\+\_\+tx\+\_\+enable (
\begin{DoxyParamCaption}
\item[{{\bf uint8\+\_\+t}}]{uart\+\_\+no}
\end{DoxyParamCaption}
)}\hypertarget{uart_8c_a9fee6d0362cbec0ae882acb55d3a825f}{}\label{uart_8c_a9fee6d0362cbec0ae882acb55d3a825f}


Enable transmit interrupts for a uart. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em uart\+\_\+no} & uart number \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
void 
\end{DoxyReturn}


Definition at line 72 of file uart.\+c.



Referenced by tx\+\_\+fifo\+\_\+putb(), tx\+\_\+fifo\+\_\+write(), and uart\+\_\+flush().



\subsection{Variable Documentation}
\index{uart.\+c@{uart.\+c}!uart\+\_\+debug\+\_\+port@{uart\+\_\+debug\+\_\+port}}
\index{uart\+\_\+debug\+\_\+port@{uart\+\_\+debug\+\_\+port}!uart.\+c@{uart.\+c}}
\subsubsection[{\texorpdfstring{uart\+\_\+debug\+\_\+port}{uart_debug_port}}]{\setlength{\rightskip}{0pt plus 5cm}int uart\+\_\+debug\+\_\+port = 0}\hypertarget{uart_8c_a08d467da958b2c20aaa794953255d152}{}\label{uart_8c_a08d467da958b2c20aaa794953255d152}


Definition at line 43 of file uart.\+c.

